package com.ljc.config;


import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;



/**
 * @Author: ljc
 * @Date:Created in 9:11 2022/2/24
 */
@Configuration
public class RabbitConfig {
    public final static  String es_queue = "es_queue";
    public final static  String es_exchange = "es_exchange";
    public final static  String es_bind_key = "es_exchange";
    @Bean
    public Queue exQueue(){
        return new Queue(es_queue);
    }
    @Bean
     DirectExchange exchange(){
     return new DirectExchange(es_exchange);
    }
    @Bean
    Binding binding(Queue queue ,DirectExchange exchange){
        return  BindingBuilder.bind(queue).to(exchange).with(es_bind_key);
    }
}
